diff --git a/cmd/nvme.c b/cmd/nvme.c
index e1ef95f..63a8e5a 100644
--- a/cmd/nvme.c
+++ b/cmd/nvme.c
@@ -9,189 +9,48 @@
 #include <command.h>
 #include <dm.h>
 #include <nvme.h>
-#include <part.h>
-#include <linux/math64.h>
 
-static int nvme_curr_device;
+static int nvme_curr_dev;
 
-static int do_nvme_scan(cmd_tbl_t *cmdtp, int flag,
-		int argc, char * const argv[])
+static int do_nvme(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int ret;
 
-	ret = nvme_scan_namespace();
-	if (ret)
-		return CMD_RET_FAILURE;
+	if (argc == 2) {
+		if (strncmp(argv[1], "scan", 4) == 0) {
+			ret = nvme_scan_namespace();
+			if (ret)
+				return CMD_RET_FAILURE;
 
-	return CMD_RET_SUCCESS;
-}
-
-static int do_nvme_list(cmd_tbl_t *cmdtp, int flag,
-		int argc, char * const argv[])
-{
-	blk_list_devices(IF_TYPE_NVME);
-
-	return CMD_RET_SUCCESS;
-}
-
-static int do_nvme_info(cmd_tbl_t *cmdtp, int flag,
-		int argc, char * const argv[])
-{
-	int devnum;
-	struct udevice *udev;
-	int ret;
-
-	if (argc > 1)
-		devnum = (int)simple_strtoul(argv[1], NULL, 10);
-	else
-		devnum = nvme_curr_device;
-
-	ret = blk_get_device(IF_TYPE_NVME, devnum, &udev);
-	if (ret < 0)
-		return CMD_RET_FAILURE;
-
-	nvme_print_info(udev);
-
-	return CMD_RET_SUCCESS;
-}
-
-static int do_nvme_device(cmd_tbl_t *cmdtp, int flag,
-		int argc, char * const argv[])
-{
-	if (argc > 1) {
-		int devnum = (int)simple_strtoul(argv[1], NULL, 10);
-
-		if (!blk_show_device(IF_TYPE_NVME, devnum)) {
-			nvme_curr_device = devnum;
-			printf("... is now current device\n");
-		} else {
-			return CMD_RET_FAILURE;
+			return ret;
 		}
-	} else {
-		blk_show_device(IF_TYPE_NVME, nvme_curr_device);
-	}
+		if (strncmp(argv[1], "deta", 4) == 0) {
+			struct udevice *udev;
 
-	return CMD_RET_SUCCESS;
-}
+			ret = blk_get_device(IF_TYPE_NVME, nvme_curr_dev,
+					     &udev);
+			if (ret < 0)
+				return CMD_RET_FAILURE;
 
-static int do_nvme_part(cmd_tbl_t *cmdtp, int flag,
-		int argc, char * const argv[])
-{
-	if (argc > 1) {
-		int devnum = (int)simple_strtoul(argv[2], NULL, 10);
+			nvme_print_info(udev);
 
-		if (blk_print_part_devnum(IF_TYPE_NVME, devnum)) {
-			printf("\nNVMe device %d not available\n", devnum);
-			return CMD_RET_FAILURE;
+			return ret;
 		}
-	} else {
-		blk_print_part_devnum(IF_TYPE_NVME, nvme_curr_device);
 	}
 
-	return CMD_RET_SUCCESS;
-}
-
-static int do_nvme_read(cmd_tbl_t *cmdtp, int flag, int argc,
-		char * const argv[])
-{
-	unsigned long time;
-	if (argc != 4)
-		return CMD_RET_USAGE;
-
-	ulong addr = simple_strtoul(argv[1], NULL, 16);
-	ulong cnt = simple_strtoul(argv[3], NULL, 16);
-	ulong n;
-	lbaint_t blk = simple_strtoul(argv[2], NULL, 16);
-
-	printf("\nNVMe read: device %d block # " LBAFU " count %ld ... ",
-	       nvme_curr_device, blk, cnt);
-
-	time = get_timer(0);
-	n = blk_read_devnum(IF_TYPE_NVME, nvme_curr_device, blk,
-			    cnt, (ulong *)addr);
-	time = get_timer(time);
-
-	printf("read: %s\n", (n == cnt) ? "OK" : "ERROR");
-	printf("%lu bytes read in %lu ms", cnt * 512, time);
-	if (time > 0) {
-		puts(" (");
-		print_size(div_u64(cnt * 512, time) * 1000, "/s");
-		puts(")");
-	}
-	puts("\n");
-
-	return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
-}
-
-static int do_nvme_write(cmd_tbl_t *cmdtp, int flag, int argc,
-		char * const argv[])
-{
-	unsigned long time;
-	if (argc != 4)
-		return CMD_RET_USAGE;
-
-	ulong addr = simple_strtoul(argv[1], NULL, 16);
-	ulong cnt = simple_strtoul(argv[3], NULL, 16);
-	ulong n;
-	lbaint_t blk = simple_strtoul(argv[2], NULL, 16);
-
-	printf("\nNVMe write: device %d block # " LBAFU " count %ld ... ",
-	       nvme_curr_device, blk, cnt);
-
-	time = get_timer(0);
-	n = blk_write_devnum(IF_TYPE_NVME, nvme_curr_device, blk,
-			    cnt, (ulong *)addr);
-	time = get_timer(time);
-
-	printf("write: %s\n", (n == cnt) ? "OK" : "ERROR");
-	printf("%lu bytes write in %lu ms", cnt * 512, time);
-	if (time > 0) {
-		puts(" (");
-		print_size(div_u64(cnt * 512, time) * 1000, "/s");
-		puts(")");
-	}
-	puts("\n");
-
-	return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
-}
-
-static cmd_tbl_t cmd_nvme[] = {
-	U_BOOT_CMD_MKENT(scan, 1, 1, do_nvme_scan, "", ""),
-	U_BOOT_CMD_MKENT(list, 1, 1, do_nvme_list, "", ""),
-	U_BOOT_CMD_MKENT(info, 2, 1, do_nvme_info, "", ""),
-	U_BOOT_CMD_MKENT(device, 2, 1, do_nvme_device, "", ""),
-	U_BOOT_CMD_MKENT(part, 2, 1, do_nvme_part, "", ""),
-	U_BOOT_CMD_MKENT(write, 4, 0, do_nvme_write, "", ""),
-	U_BOOT_CMD_MKENT(read, 4, 0, do_nvme_read, "", "")
-};
-
-static int do_nvmecops(cmd_tbl_t *cmdtp, int flag, int argc,
-		char * const argv[])
-{
-	cmd_tbl_t *cp;
-
-	cp = find_cmd_tbl(argv[1], cmd_nvme, ARRAY_SIZE(cmd_nvme));
-
-	argc--;
-	argv++;
-
-	if (cp == NULL || argc > cp->maxargs)
-		return CMD_RET_USAGE;
-
-	if (flag == CMD_FLAG_REPEAT && !cp->repeatable)
-		return CMD_RET_SUCCESS;
-
-	return cp->cmd(cmdtp, flag, argc, argv);
+	return blk_common_cmd(argc, argv, IF_TYPE_NVME, &nvme_curr_dev);
 }
 
 U_BOOT_CMD(
-	nvme, 8, 1, do_nvmecops,
+	nvme, 8, 1, do_nvme,
 	"NVM Express sub-system",
-	"\nnvme scan - scan NVMe blk devices\n"
-	"nvme list - show all available NVMe blk devices\n"
-	"nvme info [dev]- show current or a specific NVMe blk device\n"
-	"nvme device [dev] - show or set current device\n"
-	"nvme part [dev] - print partition table\n"
-	"nvme read  addr blk# cnt\n"
-	"nvme write addr blk# cnt"
+	"scan - scan NVMe devices\n"
+	"nvme detail - show details of current NVMe device\n"
+	"nvme info - show all available NVMe devices\n"
+	"nvme device [dev] - show or set current NVMe device\n"
+	"nvme part [dev] - print partition table of one or all NVMe devices\n"
+	"nvme read addr blk# cnt - read `cnt' blocks starting at block\n"
+	"     `blk#' to memory address `addr'\n"
+	"nvme write addr blk# cnt - write `cnt' blocks starting at block\n"
+	"     `blk#' from memory address `addr'"
 );
diff --git a/doc/README.nvme b/doc/README.nvme
index 3afa912..d9bda23 100644
--- a/doc/README.nvme
+++ b/doc/README.nvme
@@ -50,14 +50,14 @@
 
 To list all of the NVMe hard disks, try:
 
-  => nvme list
+  => nvme info
   Device 0: Vendor: 0x8086 Rev: 8DV10131 Prod: CVFT535600LS400BGN
 	    Type: Hard Disk
 	    Capacity: 381554.0 MB = 372.6 GB (781422768 x 512)
 
 and print out detailed information for controller and namespaces via:
 
-  => nvme info
+  => nvme detail
 
 Raw block read/write to can be done via the 'nvme read/write' commands:
 
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index 961a83d..d1bde5f 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -50,6 +50,7 @@
 	defined(CONFIG_CMD_PART) || \
 	defined(CONFIG_CMD_GPT) || \
 	defined(CONFIG_MMC) || \
+	defined(CONFIG_NVME) || \
 	defined(CONFIG_SYSTEMACE) || \
 	defined(CONFIG_SANDBOX)
 #define HAVE_BLOCK_DEVICE
